<template>
	<div>
		<div style="margin: 10px 0">基本信息</div>
		<el-descriptions title="" border :column="2" style="width: 100%">
			<el-descriptions-item label="任务名称" label-class-name="content-label">
				{{ nowRowData.taskName }}
			</el-descriptions-item>
			<el-descriptions-item label="紧急程度" label-class-name="content-label">{{ nowRowData.emergencyDegreeLabel }}</el-descriptions-item>
			<el-descriptions-item label="开始时间" label-class-name="content-label">{{ nowRowData.startTime }}</el-descriptions-item>
			<el-descriptions-item label="截止时间" label-class-name="content-label">{{ nowRowData.endTime }}</el-descriptions-item>
			<el-descriptions-item label="备注" label-class-name="content-label">{{ nowRowData.remark }} </el-descriptions-item>
		</el-descriptions>
		<div style="margin: 10px 0">任务信息</div>
		<PreviewTable :isRead="isRead" :data="tableData" :type="type" :detailType="detailType"></PreviewTable>
	</div>
</template>

<script setup lang="ts">
import { ref, reactive, toRefs, onMounted } from 'vue'
import PreviewTable from '../../previewTable/index.vue'

let props = defineProps({
	nowRowData: {
		type: Object,
		default: () => {
			return {}
		},
	},
	isRead:{
		type: Boolean,
		default: true
	},
	type:{
		type: String,
		default: 'self'
	},
	detailType:{
		type: String,
		default: 'self'
	}
})
let tableData = ref({
	head: {},
	data: [],
})
if(props.nowRowData.metadataJson){
	if( typeof props.nowRowData.metadataJson == 'string'){
		tableData.value = JSON.parse(props.nowRowData.metadataJson)
	}else{
		tableData.value = props.nowRowData.metadataJson
	}
}
</script>
<style scoped lang="scss"></style>
